From: Keir Fraser Date: Tue, 19 May 2009 00:17:16 +0000 (+0100) Subject: x86: Use PGC_cacheattr_mask rather than a hardcoded constant. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13922 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:/?a=commitdiff_plain;h=26c54bf9fae60f6e63bf49cd1591617bd8fd9e4a;p=xen.git x86: Use PGC_cacheattr_mask rather than a hardcoded constant. Signed-off-by: Patrick Colp --- diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index d11c2a1ce4..dce0fbbe1a 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -766,7 +766,7 @@ get_page_from_l1e( goto could_not_pin; if ( pte_flags_to_cacheattr(l1f) != - ((page->count_info >> PGC_cacheattr_base) & 7) ) + ((page->count_info & PGC_cacheattr_mask) >> PGC_cacheattr_base) ) { unsigned long x, nx, y = page->count_info; unsigned long cacheattr = pte_flags_to_cacheattr(l1f); @@ -782,7 +782,7 @@ get_page_from_l1e( return 0; } - while ( ((y >> PGC_cacheattr_base) & 7) != cacheattr ) + while ( ((y & PGC_cacheattr_mask) >> PGC_cacheattr_base) != cacheattr ) { x = y; nx = (x & ~PGC_cacheattr_mask) | (cacheattr << PGC_cacheattr_base); @@ -2389,7 +2389,8 @@ int get_page_type_preemptible(struct page_info *page, unsigned long type) void cleanup_page_cacheattr(struct page_info *page) { - uint32_t cacheattr = (page->count_info >> PGC_cacheattr_base) & 7; + uint32_t cacheattr = + (page->count_info & PGC_cacheattr_mask) >> PGC_cacheattr_base; if ( likely(cacheattr == 0) ) return;